package com.esri.core.geometry;

import com.esri.core.geometry.Geometry;
import java.io.Serializable;

/* loaded from: classes.dex */
public final class Polygon extends MultiPath implements Serializable {
    private static final long serialVersionUID = 2;

    @Override // com.esri.core.geometry.Geometry
    public int getDimension() {
        return 1;
    }

    public Polygon() {
        this.m_impl = new MultiPathImpl(true);
    }

    Polygon(VertexDescription vertexDescription) {
        this.m_impl = new MultiPathImpl(true, vertexDescription);
    }

    @Override // com.esri.core.geometry.Geometry
    public Geometry createInstance() {
        return new Polygon(getDescription());
    }

    @Override // com.esri.core.geometry.Geometry
    public Geometry.Type getType() {
        return Geometry.Type.POLYGON;
    }

    public double calculateRingArea2D(int i) {
        return this.m_impl.calculateRingArea2D(i);
    }

    boolean d(int i) {
        return this.m_impl.isExteriorRing(i);
    }

    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (obj == this) {
            return true;
        }
        if (obj.getClass() != getClass()) {
            return false;
        }
        return this.m_impl.equals(((Polygon) obj)._getImpl());
    }

    @Override // com.esri.core.geometry.MultiPath
    public int hashCode() {
        return this.m_impl.hashCode();
    }

    public void setXY(int i, double d, double d2) {
        this.m_impl.setXY(i, d, d2);
    }

    @Override // com.esri.core.geometry.Geometry
    public boolean isValid() {
        for (int i = 0; i < getPathCount(); i++) {
            if (isClosedPath(i) && getPathSize(i) > 2) {
                return true;
            }
        }
        return false;
    }
}
